<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查询水果</title>
    <script>
        var fruit = prompt('请输入水果名,有苹果,香蕉');

        switch (fruit) {
            case '苹果':
                alert(fruit + '---->三块一斤');
                break;
            case '香蕉':
                alert(fruit + '---->五块一斤');
                break
            default:
                alert('没有该商品');
        }
    </script>
</head>

<body>

</body>

</html>